﻿namespace VisualMove.Data
{
    public class Box
    {
        public Box(Move oMove, QRCodeWrapper oQRCode)
        {
            AssociatedMove = oMove;
            QRCode = oQRCode;
            IsPacked = true;
        }

        public bool IsPacked
        {
            get;
            set;
        }

        public Move AssociatedMove
        {
            get;
            private set;
        }

        public QRCodeWrapper QRCode
        {
            get;
            set;
        }

        public string ImageFolder
        {
            get
            {
                return QRCode.QRCode;
            }
        }

        public override bool Equals(object obj)
        {
            Box oBox = obj as Box;
            if (oBox == null)
                return false;

            return oBox.QRCode == QRCode;
        }

        public override int GetHashCode()
        {
            return QRCode.GetHashCode();
        }

        public static bool operator ==(Box oBox1, Box oBox2)
        {
            if ((object)oBox1 == null)
            {
                if ((object)oBox2 == null)
                    return true;
                return false;
            }

            return oBox1.Equals(oBox2);
        }

        public static bool operator !=(Box oBox1, Box oBox2)
        {
            if ((object)oBox1 == null)
            {
                if ((object)oBox2 == null)
                    return false;
                return true;
            }

            return !oBox1.Equals(oBox2);
        }
    }
}